@extends('layouts.admin.index')
@section('title', '修改分类')
@section('admin-css')
    .btn-success{
        margin-left:180px;
    }
    .btn-primary{
        margin-left:10px;
    }
@endsection
@section('current')
    <a href="{{ url('admin/cateList') }}" class="current">分类列表</a>
    <a href="{{ url('admin/cateEdit') }}" class="current">修改分类</a>
@endsection
@section('content')
    <div class="span7">
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon"><i class="icon-align-justify"></i></span>
                <h5>修改分类</h5>
            </div>
            <div class="widget-content nopadding">

                <form id="form-wizard" action="{{ url('admin/cateEditAction') }}" method="post" class="form-horizontal">
                    {{ csrf_field() }}
                    <input type="hidden" name="id" value="{{ $cate['id'] }}">
                    <div class="control-group">
                        <label class="control-label">分类名称 :</label>
                        <div class="controls">
                            <input type="text" name="cate_name" value="{{ $cate['cate_name'] }}" />

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">父类名称 :</label>
                        <div class="controls">
                            <select name="parent_id">
                                <option value="0">顶级分类</option>
                                @foreach ($cates as $c)
                                    <option value="{{ $c['id'] }}" {{ $cate['parent_id'] == $c['id'] ? 'selected' : '' }}>
                                        {{ str_repeat('&nbsp;', $c['count']*5).'|--'.$c['cate_name'] }}
                                    </option>
                                @endforeach

                            </select>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-success">修改</button>
                        <button type="submit" class="btn btn-primary">重置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection